package com.ws.overwrite;

public class Person {

    String name;
    int age;

    public Person() {

    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void eat() {
        System.out.println("恰饭");
    }

    public void walk(int distance) {
        System.out.println("走路，距离为：" + distance + " 公里");
        eat();//调用的是子类中的方法
    }

    public double info() {
        return 1;
    }
}
